package com.qianli.cashmama.trade.dao.impl;

import com.fqgj.common.base.AbstractBaseMapper;
import com.qianli.cashmama.trade.dao.TBankInfoDao;
import com.qianli.cashmama.trade.entity.TBankInfoEntity;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * User: sm
 * Date: 2017-07-21
 * Time: 09:10:21.056
 */

@Repository
public class TBankInfoDaoImpl extends AbstractBaseMapper<TBankInfoEntity> implements TBankInfoDao {

    @Override
    public TBankInfoEntity selectOneByTradeNo(String tradeNo) {
        Map<String, Object> map = new HashMap<>();
        map.put("tradeNo", tradeNo);
        return getSqlSession().selectOne(getStatement("selectOneByTradeNo"), map);
    }

    @Override
    public Integer updateByTradeNo(TBankInfoEntity tBankInfoEntity) {
        return getSqlSession().update(getStatement("updateByTradeNo"), tBankInfoEntity);
    }

    @Override
    public List<TBankInfoEntity> selectListByTradeNos(List<String> tradeNos) {
        Map<String, Object> map = new HashMap<>();
        map.put("tradeNos", tradeNos);
        return getSqlSession().selectList(getStatement("selectListByTradeNos"), map);
    }

    @Override
    public List<TBankInfoEntity> selectListByIdentityNo(String identityNo) {
        Map<String, Object> map = new HashMap<>();
        map.put("identityNo", identityNo);
        return getSqlSession().selectList(getStatement("selectListByIdentityNo"), map);
    }
}